15. Rover Control

14 Rover Controls

1- Download the Updated Rover simulator for Windows or MacOS. Optionally you can download it for Linux, note that this version will not work in your VM!

Follow these steps if the app failed to run on MacOS:

  1. Right click the .app file and select Show Package Contents.
  2. Rename the folder to Contents.
  3. Open a Mac Terminal
  4. Run this command:
    sh chmod 755 RoverSim_MacOS_64Bits.app/Contents/MacOS/TestingMac
  5. Go to System Preferences
  6. Select Security & Privacy
  7. Unlock and enter your password
  8. Allow the app to be loaded

2- Edit your VMWare or VMFusion network settings and make sure you are connected to the NAT network:

Windows VMWare

Windows VMWare

Mac VMFusion

Mac VMFusion

3- Navigate to Desktop and clone the GitHub repository:

$ cd Desktop
$ git clone https://github.com/udacity/RoboND-Control_Rover.git
$ cd ~/Desktop/RoboND-Control_Rover

4- Now, compile the code:

$ g++ Main.cpp -o app

5-Before your run the program, take note of the IP address of your virtual machine:

$ ifconfig

6- It’s time to run the program:

$  ./app

7- Leave your virtual machine and run the simulator. Then, select your graphics settings and enter the IP address of your Ubuntu noted earlier:

Windows Simulator

Windows Simulator

Mac Simulator

Mac Simulator

8- Select the Autonomous mode designed to accept TCP Communication!

9-Refer to this table and control your robot with keyboard commands through the Ubuntu terminal:

Command Description
w Forward
s Backward
a Left
d Right
b Brake
p Pickup Ball

10- Finally, while controlling your rover, you can visualize your keyboard commands being bounced back by the simulator (client):

Switch Statement Syntax

What is the output of this code?

#include <iostream>
using namespace std;

int main()
{
    char input_chr='a';

    switch(input_chr)
    {
        case 'a':
        cout << 'a';

        case 'b':
        cout << 'b';

        default:
        cout << 'c';

    }

    return 0;
}
SOLUTION: abc